/*******************************************************************************
* CSCI321 Major Project 2010 - University of Wollongong                        *
********************************************************************************
* Program:		WeaveEdit                                              *
* Authors:		Simon Allen (Student#: 3457527, Unix: sa655)           *
*			Scott Bellis (Student#: 3479110, Unix: sjb900)         *
*			Jason Benger (Student#: 3454137, Unix: jb960)          *
*			Timothy Newmarch (Student#: 3459263 Unix: tgn336)      *
*			Benjamin Richardson (Student# 3467752, Unix: bjr401)   *
* Supervisor:		Daniel F. Saffioti                                     *
* Modified:		28/10/2010                                             *
* Description:		WeaveEdit is a highly portable collaborative text      *
*			editor and word processor, allowing several users to   *
*			read and edit multiple documents at the same time.     *
*			It is available for Mac OS X, Windows and Linux,       *
*			utilising Nokia's Qt development framework.            *
*******************************************************************************/


#include "findoptions.h"
#include "ui_findoptions.h"


FindOptions::FindOptions(QWidget *parent) : QDialog(parent), ui(new Ui::FindOptions)
{
	ui->setupUi(this);
}

FindOptions::~FindOptions()
{
	delete ui;
}

/**
  * Get current find/replace options.
  */
QTextDocument::FindFlags FindOptions::getOptions()
{
	QTextDocument::FindFlags flags = 0;

	if (ui->checkBox_caseSensitive->isChecked())
		flags |= QTextDocument::FindCaseSensitively;

	if (ui->checkBox_matchWordOnly->isChecked())
		flags |= QTextDocument::FindWholeWords;

	return flags;
}

void FindOptions::changeEvent(QEvent *e)
{
	QDialog::changeEvent(e);

	switch (e->type())
	{
		case QEvent::LanguageChange:
			ui->retranslateUi(this);

			break;

		default:
			break;
	}
}
